#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QFile>
#include <QTableWidget>
#include <QTableWidgetItem>
#include <QComboBox>
#include "edit_form.h"
#include "dialog_help.h"
#include <QJsonDocument>
#include "common.h"
#include "smalltool.h"
#include <QListWidgetItem>
#include "dialog_config.h"
#include "./bin/dynamic_create.h"

#define MAX(a, b) a>b?a:b

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

public slots:
    void handleParseResult(QVariant data);

private slots:
    void on_pushButton_clicked();

    void on_action_edit_triggered();

    void on_action_help_triggered();

    void on_listWidget_itemClicked(QListWidgetItem *item);

    void on_tableWidget_cellChanged(int row, int column);

    void on_action_onLine_triggered();

    void on_checkBox_stateChanged(int arg1);

    void on_actionpop_triggered();

    void on_checkBox_2_stateChanged(int arg1);

private:
    Ui::MainWindow *ui;
    edit_form* _edit_form;
    Dialog_Help* _dialog_Help;
    Dialog_Config* _dialog_Config;
    int _currentPM;
//    int _currentStructIndex;
    QTimer* m_timer;

    SmallTool* _smallTool;

    void init();
    void showData();
    void readCommonJson(QString data);
    void saveCommonJson();
    void changeNameToId();

};

#endif // MAINWINDOW_H
